3.680 \(\int (a+i a \tan (e+f x))^2 (A+B \tan (e+f x)) (c-i c \tan (e+f x))^2 \, dx\)

Optimal. Leaf size=62 \[ \frac {a^2 A c^2 \tan ^3(e+f x)}{3 f}+\frac {a^2 A c^2 \tan (e+f x)}{f}+\frac {a^2 B c^2 \sec ^4(e+f x)}{4 f} \]

[Out]

1/4*a^2*B*c^2*sec(f*x+e)^4/f+a^2*A*c^2*tan(f*x+e)/f+1/3*a^2*A*c^2*tan(f*x+e)^3/f

________________________________________________________________________________________

Rubi [A]  time = 0.11, antiderivative size = 62, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 41, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.073, Rules used = {3588, 73, 641} \[ \frac {a^2 A c^2 \tan ^3(e+f x)}{3 f}+\frac {a^2 A c^2 \tan (e+f x)}{f}+\frac {a^2 B c^2 \sec ^4(e+f x)}{4 f} \]

Antiderivative was successfully verified.

[In]

Int[(a + I*a*Tan[e + f*x])^2*(A + B*Tan[e + f*x])*(c - I*c*Tan[e + f*x])^2,x]

[Out]

(a^2*B*c^2*Sec[e + f*x]^4)/(4*f) + (a^2*A*c^2*Tan[e + f*x])/f + (a^2*A*c^2*Tan[e + f*x]^3)/(3*f)

Rule 73

Int[((a_) + (b_.)*(x_))^(m_.)*((c_) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[(a*c + b*
d*x^2)^m*(e + f*x)^p, x] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && EqQ[b*c + a*d, 0] && EqQ[n, m] && Integer
Q[m]

Rule 641

Int[((d_) + (e_.)*(x_))*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Simp[(e*(a + c*x^2)^(p + 1))/(2*c*(p + 1)),
x] + Dist[d, Int[(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, p}, x] && NeQ[p, -1]

Rule 3588

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_) + (d_.)*tan[(e_
.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[(a*c)/f, Subst[Int[(a + b*x)^(m - 1)*(c + d*x)^(n - 1)*(A + B*x), x
], x, Tan[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, A, B, m, n}, x] && EqQ[b*c + a*d, 0] && EqQ[a^2 + b^2, 0]

Rubi steps

\begin {align*} \int (a+i a \tan (e+f x))^2 (A+B \tan (e+f x)) (c-i c \tan (e+f x))^2 \, dx &=\frac {(a c) \operatorname {Subst}(\int (a+i a x) (A+B x) (c-i c x) \, dx,x,\tan (e+f x))}{f}\\ &=\frac {(a c) \operatorname {Subst}\left (\int (A+B x) \left (a c+a c x^2\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {a^2 B c^2 \sec ^4(e+f x)}{4 f}+\frac {(a A c) \operatorname {Subst}\left (\int \left (a c+a c x^2\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {a^2 B c^2 \sec ^4(e+f x)}{4 f}+\frac {a^2 A c^2 \tan (e+f x)}{f}+\frac {a^2 A c^2 \tan ^3(e+f x)}{3 f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.16, size = 53, normalized size = 0.85 \[ \frac {a^2 A c^2 \left (\frac {1}{3} \tan ^3(e+f x)+\tan (e+f x)\right )}{f}+\frac {a^2 B c^2 \sec ^4(e+f x)}{4 f} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + I*a*Tan[e + f*x])^2*(A + B*Tan[e + f*x])*(c - I*c*Tan[e + f*x])^2,x]

[Out]

(a^2*B*c^2*Sec[e + f*x]^4)/(4*f) + (a^2*A*c^2*(Tan[e + f*x] + Tan[e + f*x]^3/3))/f

________________________________________________________________________________________

fricas [C]  time = 0.68, size = 104, normalized size = 1.68 \[ \frac {{\left (12 i \, A + 12 \, B\right )} a^{2} c^{2} e^{\left (4 i \, f x + 4 i \, e\right )} + 16 i \, A a^{2} c^{2} e^{\left (2 i \, f x + 2 i \, e\right )} + 4 i \, A a^{2} c^{2}}{3 \, {\left (f e^{\left (8 i \, f x + 8 i \, e\right )} + 4 \, f e^{\left (6 i \, f x + 6 i \, e\right )} + 6 \, f e^{\left (4 i \, f x + 4 i \, e\right )} + 4 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^2*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^2,x, algorithm="fricas")

[Out]

1/3*((12*I*A + 12*B)*a^2*c^2*e^(4*I*f*x + 4*I*e) + 16*I*A*a^2*c^2*e^(2*I*f*x + 2*I*e) + 4*I*A*a^2*c^2)/(f*e^(8
*I*f*x + 8*I*e) + 4*f*e^(6*I*f*x + 6*I*e) + 6*f*e^(4*I*f*x + 4*I*e) + 4*f*e^(2*I*f*x + 2*I*e) + f)

________________________________________________________________________________________

giac [B]  time = 1.87, size = 411, normalized size = 6.63 \[ \frac {3 \, B a^{2} c^{2} \tan \left (f x\right )^{4} \tan \relax (e)^{4} - 12 \, A a^{2} c^{2} \tan \left (f x\right )^{4} \tan \relax (e)^{3} - 12 \, A a^{2} c^{2} \tan \left (f x\right )^{3} \tan \relax (e)^{4} + 6 \, B a^{2} c^{2} \tan \left (f x\right )^{4} \tan \relax (e)^{2} + 6 \, B a^{2} c^{2} \tan \left (f x\right )^{2} \tan \relax (e)^{4} - 4 \, A a^{2} c^{2} \tan \left (f x\right )^{4} \tan \relax (e) + 24 \, A a^{2} c^{2} \tan \left (f x\right )^{3} \tan \relax (e)^{2} + 24 \, A a^{2} c^{2} \tan \left (f x\right )^{2} \tan \relax (e)^{3} - 4 \, A a^{2} c^{2} \tan \left (f x\right ) \tan \relax (e)^{4} + 3 \, B a^{2} c^{2} \tan \left (f x\right )^{4} + 12 \, B a^{2} c^{2} \tan \left (f x\right )^{2} \tan \relax (e)^{2} + 3 \, B a^{2} c^{2} \tan \relax (e)^{4} + 4 \, A a^{2} c^{2} \tan \left (f x\right )^{3} - 24 \, A a^{2} c^{2} \tan \left (f x\right )^{2} \tan \relax (e) - 24 \, A a^{2} c^{2} \tan \left (f x\right ) \tan \relax (e)^{2} + 4 \, A a^{2} c^{2} \tan \relax (e)^{3} + 6 \, B a^{2} c^{2} \tan \left (f x\right )^{2} + 6 \, B a^{2} c^{2} \tan \relax (e)^{2} + 12 \, A a^{2} c^{2} \tan \left (f x\right ) + 12 \, A a^{2} c^{2} \tan \relax (e) + 3 \, B a^{2} c^{2}}{12 \, {\left (f \tan \left (f x\right )^{4} \tan \relax (e)^{4} - 4 \, f \tan \left (f x\right )^{3} \tan \relax (e)^{3} + 6 \, f \tan \left (f x\right )^{2} \tan \relax (e)^{2} - 4 \, f \tan \left (f x\right ) \tan \relax (e) + f\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^2*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^2,x, algorithm="giac")

[Out]

1/12*(3*B*a^2*c^2*tan(f*x)^4*tan(e)^4 - 12*A*a^2*c^2*tan(f*x)^4*tan(e)^3 - 12*A*a^2*c^2*tan(f*x)^3*tan(e)^4 +
6*B*a^2*c^2*tan(f*x)^4*tan(e)^2 + 6*B*a^2*c^2*tan(f*x)^2*tan(e)^4 - 4*A*a^2*c^2*tan(f*x)^4*tan(e) + 24*A*a^2*c
^2*tan(f*x)^3*tan(e)^2 + 24*A*a^2*c^2*tan(f*x)^2*tan(e)^3 - 4*A*a^2*c^2*tan(f*x)*tan(e)^4 + 3*B*a^2*c^2*tan(f*
x)^4 + 12*B*a^2*c^2*tan(f*x)^2*tan(e)^2 + 3*B*a^2*c^2*tan(e)^4 + 4*A*a^2*c^2*tan(f*x)^3 - 24*A*a^2*c^2*tan(f*x
)^2*tan(e) - 24*A*a^2*c^2*tan(f*x)*tan(e)^2 + 4*A*a^2*c^2*tan(e)^3 + 6*B*a^2*c^2*tan(f*x)^2 + 6*B*a^2*c^2*tan(
e)^2 + 12*A*a^2*c^2*tan(f*x) + 12*A*a^2*c^2*tan(e) + 3*B*a^2*c^2)/(f*tan(f*x)^4*tan(e)^4 - 4*f*tan(f*x)^3*tan(
e)^3 + 6*f*tan(f*x)^2*tan(e)^2 - 4*f*tan(f*x)*tan(e) + f)

________________________________________________________________________________________

maple [A]  time = 0.02, size = 53, normalized size = 0.85 \[ \frac {a^{2} c^{2} \left (\frac {B \left (\tan ^{4}\left (f x +e \right )\right )}{4}+\frac {A \left (\tan ^{3}\left (f x +e \right )\right )}{3}+\frac {B \left (\tan ^{2}\left (f x +e \right )\right )}{2}+A \tan \left (f x +e \right )\right )}{f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+I*a*tan(f*x+e))^2*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^2,x)

[Out]

1/f*a^2*c^2*(1/4*B*tan(f*x+e)^4+1/3*A*tan(f*x+e)^3+1/2*B*tan(f*x+e)^2+A*tan(f*x+e))

________________________________________________________________________________________

maxima [A]  time = 0.46, size = 72, normalized size = 1.16 \[ \frac {3 \, B a^{2} c^{2} \tan \left (f x + e\right )^{4} + 4 \, A a^{2} c^{2} \tan \left (f x + e\right )^{3} + 6 \, B a^{2} c^{2} \tan \left (f x + e\right )^{2} + 12 \, A a^{2} c^{2} \tan \left (f x + e\right )}{12 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^2*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^2,x, algorithm="maxima")

[Out]

1/12*(3*B*a^2*c^2*tan(f*x + e)^4 + 4*A*a^2*c^2*tan(f*x + e)^3 + 6*B*a^2*c^2*tan(f*x + e)^2 + 12*A*a^2*c^2*tan(
f*x + e))/f

________________________________________________________________________________________

mupad [B]  time = 8.49, size = 82, normalized size = 1.32 \[ \frac {a^2\,c^2\,\sin \left (e+f\,x\right )\,\left (12\,A\,{\cos \left (e+f\,x\right )}^3+6\,B\,{\cos \left (e+f\,x\right )}^2\,\sin \left (e+f\,x\right )+4\,A\,\cos \left (e+f\,x\right )\,{\sin \left (e+f\,x\right )}^2+3\,B\,{\sin \left (e+f\,x\right )}^3\right )}{12\,f\,{\cos \left (e+f\,x\right )}^4} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((A + B*tan(e + f*x))*(a + a*tan(e + f*x)*1i)^2*(c - c*tan(e + f*x)*1i)^2,x)

[Out]

(a^2*c^2*sin(e + f*x)*(12*A*cos(e + f*x)^3 + 3*B*sin(e + f*x)^3 + 4*A*cos(e + f*x)*sin(e + f*x)^2 + 6*B*cos(e
+ f*x)^2*sin(e + f*x)))/(12*f*cos(e + f*x)^4)

________________________________________________________________________________________

sympy [C]  time = 0.60, size = 167, normalized size = 2.69 \[ \frac {16 A a^{2} c^{2} e^{2 i e} e^{2 i f x} + 4 A a^{2} c^{2} + \left (12 A a^{2} c^{2} e^{4 i e} - 12 i B a^{2} c^{2} e^{4 i e}\right ) e^{4 i f x}}{- 3 i f e^{8 i e} e^{8 i f x} - 12 i f e^{6 i e} e^{6 i f x} - 18 i f e^{4 i e} e^{4 i f x} - 12 i f e^{2 i e} e^{2 i f x} - 3 i f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))**2*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))**2,x)

[Out]

(16*A*a**2*c**2*exp(2*I*e)*exp(2*I*f*x) + 4*A*a**2*c**2 + (12*A*a**2*c**2*exp(4*I*e) - 12*I*B*a**2*c**2*exp(4*
I*e))*exp(4*I*f*x))/(-3*I*f*exp(8*I*e)*exp(8*I*f*x) - 12*I*f*exp(6*I*e)*exp(6*I*f*x) - 18*I*f*exp(4*I*e)*exp(4
*I*f*x) - 12*I*f*exp(2*I*e)*exp(2*I*f*x) - 3*I*f)

________________________________________________________________________________________